package org.example;

import org.example.demo.Supermarket;

/**
 * 测试
 */
public class Main {
    public static void main(String[] args) {
        Supermarket supermarket = new Supermarket();

        // 顾客A购买苹果和草莓
        double totalPriceA = supermarket.calculateTotalPrice("apple", 2.5) +
                supermarket.calculateTotalPrice("strawberry", 1.5);
                 System.out.println("会产生冲突？");
        System.out.println("mas会产生冲突？");
        System.out.println("顾客A的总价：" + totalPriceA);

        // 顾客B购买苹果、草莓和芒果
        double totalPriceB = supermarket.calculateTotalPrice("apple", 1.5) +
                supermarket.calculateTotalPrice("strawberry", 2.0) +
                supermarket.calculateTotalPrice("mango", 0.5);
        System.out.println("顾客B的总价：" + totalPriceB);

        // 顾客C购买苹果、草莓和芒果（如果打折把草莓类里面的标识设置为true）
        double totalPriceC = supermarket.calculateTotalPrice("apple", 3.0) +
                supermarket.calculateTotalPrice("strawberry", 1.0) +
                supermarket.calculateTotalPrice("mango", 1.5);
        System.out.println("顾客C的总价：" + totalPriceC);

        // 顾客D购买苹果、草莓和芒果（考虑满减优惠）
        double totalPriceD = supermarket.calculateTotalPrice("apple", 4.0) +
                supermarket.calculateTotalPrice("strawberry", 3.0) +
                supermarket.calculateTotalPrice("mango", 2.0);
        if (totalPriceD >= 100) {
            // 满100减10块优惠
            totalPriceD -= 10;
        }
        System.out.println("顾客D的总价：" + totalPriceD);
    }
}
